package org.base;

import javax.inject.Named;
import javax.faces.view.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.inject.Inject;

@Named(value = "estadoNomenclaturaController")
@ViewScoped
public class EstadoNomenclaturaController extends AbstractController<EstadoNomenclatura> {

    @Inject
    private NomenclaturaCatastralController nomenclaturaCatastralCollectionController;

    public EstadoNomenclaturaController() {
        // Inform the Abstract parent controller of the concrete EstadoNomenclatura?cap_first Entity
        super(EstadoNomenclatura.class);
    }

    /**
     * Resets the "selected" attribute of any parent Entity controllers.
     */
    public void resetParents() {
    }

    /**
     * Sets the "items" attribute with a collection of NomenclaturaCatastral
     * entities that are retrieved from EstadoNomenclatura?cap_first and returns
     * the navigation outcome.
     *
     * @return navigation outcome for NomenclaturaCatastral page
     */
    public String navigateNomenclaturaCatastralCollection() {
        if (this.getSelected() != null) {
            FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("NomenclaturaCatastral_items", this.getSelected().getNomenclaturaCatastralCollection());
        }
        return "/nomenclaturaCatastral/index";
    }

}
